IF  EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[MasterEventLog]'))
BEGIN
     ALTER FULLTEXT INDEX ON [dbo].[MasterEventLog] DISABLE
END
GO

IF  EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[MasterEventLog]'))
BEGIN
     DROP FULLTEXT INDEX ON [dbo].[MasterEventLog]
END
GO

IF  EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'MasterEventLogFTCatalog') 
BEGIN
     DROP FULLTEXT CATALOG [MasterEventLogFTCatalog]
END
GO

CREATE FULLTEXT CATALOG [MasterEventLogFTCatalog]WITH ACCENT_SENSITIVITY = ON AUTHORIZATION [dbo]
GO

CREATE FULLTEXT INDEX ON [dbo].[MasterEventLog](
     [AppName]           LANGUAGE [English], 
     [DatabaseName]      LANGUAGE [English], 
     [DatabaseUserName]  LANGUAGE [English], 
     [HostName]          LANGUAGE [English], 
     [LogByApp]          LANGUAGE [English], 
     [LogByAppSubSystem] LANGUAGE [English], 
     [LogByDesc]         LANGUAGE [English], 
     [LoginName]         LANGUAGE [English], 
     [LogText]           LANGUAGE [English], 
     [MiscVC1]           LANGUAGE [English], 
     [MiscVC2]           LANGUAGE [English], 
     [MiscVC3]           LANGUAGE [English], 
     [MiscVC4]           LANGUAGE [English], 
     [TraceText]         LANGUAGE [English])
     KEY INDEX [IX_MasterEventLog_RecordGUID] 
          ON ([MasterEventLogFTCatalog], FILEGROUP [Data_FTIndex]) WITH (CHANGE_TRACKING = AUTO, STOPLIST = SYSTEM)
GO
